package com.cl.short_video_java.web.client.order;

import com.cl.short_video_java.annotation.Login;
import com.cl.short_video_java.common.Const;
import com.cl.short_video_java.common.Result;
import com.cl.short_video_java.service.VideoShopOrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author 付
 * @Date 2024-11-20 14:54
 * @Version 1.0
 * @description
 * @since 1.0
 */
@RestController
@RequestMapping("/client/order")
public class ClientShopOrderController {

	private VideoShopOrderService orderService;

	ClientShopOrderController(VideoShopOrderService orderService) {
		this.orderService = orderService;
	}

	/**
	 * 获取订单记录
	 *
	 * @return
	 */
	@Login(issuer = Const.GRADE_USER)
	@GetMapping("/list")
	public Result list(@RequestParam("pageNum") Integer pageNum, HttpServletRequest request) {
		return Result.success(orderService.getByUserOrder(pageNum,request));
	}

}
